# -*- coding: UTF-8 -*-
# Author: Damon(wuud1)
# CreateDate:
# Message:


import requests
import json

headers = {
    "Host": "aam-china.contitech.de",
    "Origin": "http://aam-china.contitech.de",
    "X-Requested-With": "XMLHttpRequest",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
    "Content-Type": "application/json; charset=UTF-8",
    "Referer": "http://aam-china.contitech.de/pages/web-katalog/referenznummern_cn.cshtml",
}

cookies = {
    "ASPSESSIONIDASDAQQAT": "HJLIEENCNOGFGJOIHDGBIJFK",
    "ASP.NET_SessionId": "webqo20qucgafwvof0qkbh3o",
    "AAMPICLanguage": "cn",
    "AAMPICRegion": "CN",
    "_pk_id.113.08dd": "61470eefe7b44851.1533727624.4.1534131921.1534126622.",
}

post_data = {
    "Suchstring": "%11287545346%"
}
# json_data = json.dumps(post_data)

url = 'http://aam-china.contitech.de/pages/web-katalog/WebService.asmx/ReferenznummerArtikelAuslesen'

res = requests.post(url=url, headers=headers, cookies=cookies, json=post_data)
data = res.content.decode('utf8')
# data = r'{"d":"[[\"11287545346\",\"5PK1165\",\"001\",\"\",\"6\"]]"}'
print data
#
# a = json.loads(data)
# b = json.loads(a['d'])
# print type(b), b
# for i in b:
#     for j in i:
#         print j

# dict_data = json.loads(data)
#
# for i in dict_data['d']:
#     for j in i:
#         print j


# a = []
#
# if not a:
#     print "xxx"
# else:
#     print "sss"